package com.gec.teams.wechat.controller;

import com.gec.teams.wechat.common.utils.R;
import com.gec.teams.wechat.vo.TbUser;
import com.gec.teams.wechat.vo.TestSayHelloVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.io.Serializable;

@RestController
@RequestMapping("/test")
@Api("测试Web接口")//Swagger声明类加@Api注解, 并说明
public class TestController {

    @PostMapping("/sayHello")
    @ApiOperation("最简单的测试方法") //Swagger声明方法添加@ApiOperation注解,(方法说明)
    public R sayHello(@Valid @RequestBody TestSayHelloVo vo){
        return R.ok().put("msg", "Hello"+vo.getName());
    }

    @PostMapping("/test2")
    @ApiOperation("测试")
    public R test(TbUser tb){
        return R.ok();

    }


}